fix(core): bind Mod-a to select all the document - #2975
Conversation
|
@Asodariyasujal is attempting to deploy a commit to the TypeCell Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe block information API now handles document-boundary positions. The keyboard shortcut extension maps Mod-A to full-document selection. Tests cover multi-block selection, clearing, block retrieval, and closed math-block shortcuts. ChangesDocument Boundary Resolution
Select-All Keyboard Handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The change makes Mod-a reliably select the entire document, including documents beginning with checklist items, so clearing the document behaves consistently. No actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
BlockNote had no `Mod-a` binding, so select-all was left to the browser's native `contenteditable` handling and ProseMirror had to rebuild a document selection from the DOM selection it produced. That fails when a block puts non-editable content first, which check list items do: the checkbox div sits ahead of the `<p>` holding the block's content. So in a document starting with a check list item, ProseMirror could not map the DOM selection to a valid position and dropped it, leaving the caret in place - Backspace then only edited that one block instead of clearing the document. Now `Mod-a` sets an `AllSelection` itself, which selects every block type reliably and deletes down to a single empty paragraph. Also stops `getNearestBlockPos` warning for the positions at the very start and end of the doc, which is where an `AllSelection` ends.
dab8844 to
5adfe7e
Compare
|
@coderabbitai review |
|
BlockNote had no
Mod-abinding, so select-all was left to the browser's nativecontenteditablehandling and ProseMirror had to rebuild a document selection from the DOM selection it produced.That fails when a block puts non-editable content first, which check list items do: the checkbox div sits ahead of the
<p>holding the block's content. So in a document starting with a check list item, ProseMirror could not map the DOM selection to a valid position and dropped it, leaving the caret in place - Backspace then only edited that one block instead of clearing the document.Now
Mod-asets anAllSelectionitself, which selects every block type reliably and deletes down to a single empty paragraph.Also stops
getNearestBlockPoswarning for the positions at the very start and end of the doc, which is where anAllSelectionends.Summary by CodeRabbit
New Features
Bug Fixes
Tests